using System;
using InfoJetSoft.Service.Entity;

namespace InfoJetSoft.Service.ManagedCode
{
	/// <summary>
	/// Summary description for WindowObject.
	/// </summary>
	public class WindowObject : Microsoft.Office.Interop.InfoPath.SemiTrust.WindowObject
	{
		private Form form = null;
		private TaskPanes taskPanes = null;
		private MailEnvelopeObject mailEnvelope = null;

		public WindowObject( Form frm )
		{
			this.form = frm;
			this.taskPanes = new TaskPanes( this.form );
			this.mailEnvelope = new MailEnvelopeObject( this.form );
		}

		public void Close(bool fForce)
		{
			this.form.IsCloseDoc = true;
			this.form.IsPromptToSaveChanges = !fForce;
		}

		public Microsoft.Office.Interop.InfoPath.SemiTrust.TaskPanesCollection TaskPanes 
		{ 
			get
			{ 
				return this.taskPanes; 
			} 
		}

		public Microsoft.Office.Interop.InfoPath.SemiTrust.MailEnvelopeObject MailEnvelope 
		{ 
			get
			{ 
				return this.mailEnvelope; 
			} 
		}
			
		public object CommandBars { get{ return null; } }
		public Microsoft.Office.Interop.InfoPath.SemiTrust.XDocument XDocument { get{ return null; } }
		public bool Active { get{ return true; } }
		public void Activate(){}
		public Microsoft.Office.Interop.InfoPath.SemiTrust.XdWindowType WindowType { get{ return Microsoft.Office.Interop.InfoPath.SemiTrust.XdWindowType.xdEditorWindow; } }
		public int Top { get{return 0;} set{} }
		public int Left { get{return 0;} set{} }
		public int Width { get{return 0;} set{} }
		public int Height { get{return 0;} set{} }
		public string Caption { get{ return "";} set{} }
		public Microsoft.Office.Interop.InfoPath.SemiTrust.XdWindowState WindowState { get{ return Microsoft.Office.Interop.InfoPath.SemiTrust.XdWindowState.xdWindowStateMaximize; } set{} }
	}
}
